﻿using System;
using System.Windows.Forms;
using SoftLab.Reportes;

namespace SoftLab.Formularios
{
    public partial class Principal : Form
    {
        public Principal()
        {
            InitializeComponent();

            versionText.Text = "Versión: " + Properties.Settings.Default.Version;
            bdText.Text = "Database: laboratorio.db";

            #region Métodos del menú

            pacientesToolStripMenuItem.Click += (sender, e) =>
            {
                var p = Pacientes.getInstance();
                p.MdiParent = this;
                p.Show();
            };

            usuariosToolStripMenuItem.Click += (sender, e) =>
            {
                var u = Usuarios.getInstance();
                u.MdiParent = this;
                u.Show();
            };

            químicaSanguíneaToolStripMenuItem.Click += (sender, e) =>
            {
                var q = Quimica.GetInstance();
                q.MdiParent = this;
                q.Show();
            };

            urianálisisToolStripMenuItem.Click += (sender, e) =>
            {
                var u = Urianalisis.GetInstance();
                u.MdiParent = this;
                u.Show();
            };

            hematologíaToolStripMenuItem.Click += (sender, e) =>
            {
                var h = Hematología.GetInstance();
                h.MdiParent = this;
                h.Show();
            };

            hemogramaToolStripMenuItem.Click += (sender, e) =>
            {
                var he = Hemograma.GetInstance();
                he.MdiParent = this;
                he.Show();
            };

            microbiologíaToolStripMenuItem.Click += (sender, e) =>
            {
                var m = Microbiología.GetInstance();
                m.MdiParent = this;
                m.Show();
            };

            serologíaToolStripMenuItem.Click += (sender, e) =>
            {
                var s = Serología.GetInstance();
                s.MdiParent = this;
                s.Show();
            };

            parasitologíaToolStripMenuItem.Click += (sender, e) =>
            {
                var p = Parasitología.GetInstance();
                p.MdiParent = this;
                p.Show();
            };

            pruebasHormonalesToolStripMenuItem.Click += (sender, e) =>
            {
                var hor = Hormonales.GetInstance();
                hor.MdiParent = this;
                hor.Show();
            };

            pruebasAntidopingToolStripMenuItem.Click += (sender, e) =>
            {
                var a = Antidoping.GetInstance();
                a.MdiParent = this;
                a.Show();
            };

            coprológicoToolStripMenuItem.Click += (sender, e) =>
            {
                var c = Coprológico.GetInstance();
                c.MdiParent = this;
                c.Show();
            };

            acercaDeToolStripMenuItem.Click += (sender, e) => new Acerca().ShowDialog();

            reimprimirPruebaToolStripMenuItem.Click += (sender, args) =>
            {
                throw new NotImplementedException("Sigo en esto todavía");
            };

            #endregion
        }

        private void Principal_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void salirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
